<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::prefix('student')->group(function () {//学生管理
    Route::get('index', 'StudentController@index');//学生列表
    Route::post('save', 'StudentController@save');//学生添加
    Route::delete('del/{id}', 'StudentController@del');//学生删除
    Route::get('get/{id}', 'StudentController@get');//学生获取
    Route::post('edit', 'StudentController@edit');//学生修改
});
Route::apiResource('student_class', 'StudentClassController');//班级管理